cmake_minimum_required(VERSION 3.5)

project(mytest)

set(TEST_TARGET mytest)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

include_directories(../include)
find_package(GTest REQUIRED)
add_executable(${TEST_TARGET} test.cpp test1.cpp ../src/person.cpp)

target_link_libraries(${TEST_TARGET} PRIVATE GTest::GTest GTest::Main)

install(TARGETS mytest
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})

add_test(NAME ${TEST_TARGET} COMMAND ${TEST_TARGET} --gtest_filter=AutoTest1.*)